package com.lht.testDemo;

import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-11-18
 */
public class MapTest {

    @Test
    public void test() {
        Map<String, String> map = new HashMap<>();
        map.put("hell", "world");
        map.put("lht", "lht");

        for (Map.Entry<String, String> entry : map.entrySet()) {
            System.out.println(entry.getKey() + ":" + entry.getValue());
            if (map.containsKey("hell")) {
                System.out.println("has hell");
//                map.remove("hell");
            }
        }
    }
}
